/**
 * Copyright 2010 Zhou Zhao
 *
 * This file is part of FPGA compiler for EE680 USC
 *
   FPGA compiler is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   FPGA compiler is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * In global routing, the track between two swtichbox is modeled in class of
 * track. Each track object has fields of "capacity" for congestion computation.
 * It also has x, y coordinates and id.
 */

package edu.usc.ee.java;

/**
 * @author zhouzhao
 * @version 1.0
 */

public class track {

    private int capacity;
    private int weight; // weight field is the max capacity of each track

    private int id;
    private int x;
    private int y;

    public track(int id, int x, int y)
    {
        this.id = id;
        this.x = x;
        this.y = y;

        this.weight = 0;
        this.capacity = 0;
    }

    public track(int id, int x, int y, int weight)
    {
        this.id = id;
        this.x = x;
        this.y = y;

        this.weight = weight;
        this.capacity = 0;
    }

    public int getID()
    {
        return this.id;
    }

    public int getx()
    {
        return this.x;
    }

    public int gety()
    {
        return this.y;
    }

    public int getWeight()
    {
        return this.weight;
    }

    public void setWeight(int weight)
    {
        this.weight = weight;
    }

    public int getCapacity()
    {
        return this.capacity;
    }

    public void setCapacity(int capacity)
    {
        this.capacity = capacity;
    }

    @Override
    public String toString()
    {
        return "E"+id+"("+x+","+y+")";
    }
    
}
